/** @jsxImportSource @emotion/react */
import * as React from "react";
import {CCell, Cell, Table, TableBody, TableRow, Text,} from "customize-easy-ui-component";
import {DirectLink} from "../../../routing/Link";
import {TailMenRowIspCheck} from "../../contain/rarelyVary";

export const 附加检验报告= ({theme, orc, rep,jyjg='存在问题'} :{theme: any, orc:any, rep:any,jyjg?:string}
) => {
  //【表格助手】 JSON.parse(orc?._tblFixed??'[]') 【拉表格列】 直接替换目标表的fixed字段 ：【修改列宽】 【调整宽度】
  return <>
        <div css={{"@media print": {paddingBottom: '4rem', pageBreakInside: 'avoid'}} }>
          <Text id='AdditionalTest' variant="h2" css={{
            textAlign: 'center', marginTop: '1rem',
          }}>附加检验报告</Text>
          <div css={{
            display: 'flex',
            justifyContent: 'space-between'
          }}>
            <Text>单位内部编号：{orc.单位内部编号}</Text>
            <Text>报告编号：{rep.isp.no}</Text>
          </div>
        </div>
        <Table  fixed={ ["17%","34%","17%","%"] }  tight  miniw={800}
            css={ {borderCollapse: 'collapse', "@media print": {marginTop: '-4rem'}} } >
            <TableBody>
              <DirectLink href={`/report/${rep?.modeltype}/ver/${rep?.modelversion}/${rep?.id}/AdditionalTest#AdditionalTest`}>
                <TableRow>
                  <CCell colSpan={4}>导静电装置检查</CCell>
                </TableRow>
                <TableRow>
                  <CCell>测试仪器型号</CCell>
                  <CCell>{orc.静电测试仪器}</CCell>
                  <CCell>仪器精度</CCell>
                  <CCell>{orc.静电测试精度}</CCell>
                </TableRow>
                <TableRow>
                  <CCell>导静电电阻</CCell>
                  <CCell><div css={{ display: 'flex',justifyContent: 'space-around',alignItems: 'center'}}>
                    <Text >{orc.导静电电阻}</Text>
                    <Text css={{ [theme.mediaQueries.lg+', print']: {wordBreak: 'keep-all'} }}>
                      Ω</Text>
                  </div></CCell>
                  <CCell>连接处电阻</CCell>
                  <CCell><div css={{ display: 'flex',justifyContent: 'space-around',alignItems: 'center'}}>
                    <Text >{orc.连接处电阻}</Text>
                    <Text css={{ [theme.mediaQueries.lg+', print']: {wordBreak: 'keep-all'} }}>
                      Ω</Text>
                  </div></CCell>
                </TableRow>
                <TableRow>
                  <CCell colSpan={4}>绝热层真空度检查</CCell>
                </TableRow>
                <TableRow>
                  <CCell>真空仪型号</CCell>
                  <CCell>{orc.真空仪型号}</CCell>
                  <CCell>仪器精度</CCell>
                  <CCell>{orc.真空仪精度}</CCell>
                </TableRow>
                <TableRow>
                  <CCell>空载时真空度</CCell>
                  <CCell><div css={{ display: 'flex',justifyContent: 'space-around',alignItems: 'center'}}>
                    <Text >{orc.空载真空度}</Text>
                    <Text css={{ [theme.mediaQueries.lg+', print']: {wordBreak: 'keep-all'} }}>
                      Pa</Text>
                  </div></CCell>
                  <CCell>承载时真空度</CCell>
                  <CCell><div css={{ display: 'flex',justifyContent: 'space-around',alignItems: 'center'}}>
                    <Text >{orc.承载真空度}</Text>
                    <Text css={{ [theme.mediaQueries.lg+', print']: {wordBreak: 'keep-all'} }}>
                      Pa</Text>
                  </div></CCell>
                </TableRow>
              </DirectLink>
            </TableBody>
          </Table>
          <Table  fixed={  ["15%","21%","12%","20%","11%","%"]  } css={ {borderCollapse: 'collapse' } }  tight  miniw={800}>
            <TableBody>
              <DirectLink href={`/report/${rep?.modeltype}/ver/${rep?.modelversion}/${rep?.id}/AdditionalTest#AdditionalTest`}>
                <TableRow>
                  <CCell colSpan={6}>罐体抽真空 、气体置换</CCell>
                </TableRow>
                <TableRow>
                  <CCell>真空泵型号</CCell>
                  <CCell>{orc.真空泵型号}</CCell>
                  <CCell>抽真空时间</CCell>
                  <CCell><div css={{ display: 'flex',justifyContent: 'space-around',alignItems: 'center'}}>
                    <Text >{orc.抽真空时间}</Text>
                    <Text css={{ [theme.mediaQueries.lg+', print']: {wordBreak: 'keep-all'} }}>
                      h</Text>
                  </div></CCell>
                  <CCell>罐内真空度</CCell>
                  <CCell><div css={{ display: 'flex',justifyContent: 'space-around',alignItems: 'center'}}>
                    <Text >{orc.罐内真空度}</Text>
                    <Text css={{ [theme.mediaQueries.lg+', print']: {wordBreak: 'keep-all'} }}>
                      Pa</Text>
                  </div></CCell>
                </TableRow>
                <TableRow>
                  <CCell>置换介质</CCell>
                  <CCell colSpan={2}>{orc.抽空置换介质}</CCell>
                  <CCell>置换压力</CCell>
                  <CCell colSpan={2}><div css={{ display: 'flex',justifyContent: 'space-around',alignItems: 'center'}}>
                    <Text >{orc.抽空置换压}</Text>
                    <Text css={{ [theme.mediaQueries.lg+', print']: {wordBreak: 'keep-all'} }}>
                      MPa</Text>
                  </div></CCell>
                </TableRow>
                <TableRow>
                  <CCell>排放后罐内压力</CCell>
                  <CCell colSpan={2}><div css={{ display: 'flex',justifyContent: 'space-around',alignItems: 'center'}}>
                    <Text >{orc.排放后压力}</Text>
                    <Text css={{ [theme.mediaQueries.lg+', print']: {wordBreak: 'keep-all'} }}>
                      MPa</Text>
                  </div></CCell>
                  <CCell colSpan={2}>罐内气体含氧量（≤3％）</CCell>
                  <CCell>{orc.含氧量}</CCell>
                </TableRow>
              </DirectLink>
              <DirectLink href={`/report/${rep?.modeltype}/ver/${rep?.modelversion}/${rep?.id}/Corrosive#Corrosive`}>
                <TableRow>
                  <CCell colSpan={6}>腐蚀介质含量测定</CCell>
                </TableRow>
                <TableRow>
                  <CCell>介质名称</CCell>
                  <CCell colSpan={2}>{orc.腐蚀介质名称}</CCell>
                  <CCell>腐蚀介质成分</CCell>
                  <CCell colSpan={2}>{orc.腐蚀介质成分}</CCell>
                </TableRow>
                <TableRow>
                  <CCell>腐蚀介质含量</CCell>
                  <CCell><div css={{ display: 'flex',justifyContent: 'space-evenly',alignItems: 'center'}}>
                    <Text>{orc.腐蚀介质含量}</Text>
                    <Text css={{ [theme.mediaQueries.lg+', print']: {wordBreak: 'keep-all'} }}>
                      %</Text>
                  </div></CCell>
                  <CCell>腐蚀速度</CCell>
                  <CCell><div css={{ display: 'flex',justifyContent: 'space-around',alignItems: 'center'}}>
                    <Text >{orc.腐蚀速度}</Text>
                    <Text css={{ [theme.mediaQueries.lg+', print']: {wordBreak: 'keep-all'} }}>
                      mm/y</Text>
                  </div></CCell>
                  <CCell>腐蚀机理</CCell>
                  <CCell>{orc.腐蚀机理}</CCell>
                </TableRow>
                <TableRow>
                  <Cell split={true} colSpan={6}><div css={{minHeight: '3rem', whiteSpace: 'pre-wrap'}}>其他检验、检测：<br/>
                    {orc.附加检验其他 || '／'}
                  </div></Cell>
                </TableRow>
                <TableRow>
                  <Cell split={true} colSpan={6}><div css={{minHeight: '2rem', whiteSpace: 'pre-wrap'}}>备注：<br/>
                    {orc.附加检验备注 || '／'}
                  </div></Cell>
                </TableRow>
                <TableRow>
                  <Cell split={true} colSpan={6}><div css={{minHeight: '2rem', whiteSpace: 'pre-wrap'}}>{jyjg}：<br/>
                    {orc.附加检测结果 || '／'}
                  </div></Cell>
                </TableRow>
              </DirectLink>
            </TableBody>
          </Table>
    <TailMenRowIspCheck orc={orc} rep={rep} />
  </>;
};

